package basicas;

import java.util.List;

import javax.persistence.FetchType;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import org.hibernate.annotations.Cascade;

import util.ObjetoSistema;

@Entity
public class Equipe {

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	private int codEquipe;
	@OneToOne(cascade = CascadeType.ALL)
	private Aluno lider;
	@OneToMany(mappedBy = "equipe")
	@Cascade(org.hibernate.annotations.CascadeType.SAVE_UPDATE)
	private List<Aluno> membros;

	public Equipe() {
	}

	public int getCodEquipe() {
		return codEquipe;
	}

	public void setCodEquipe(int codEquipe) {
		this.codEquipe = codEquipe;
	}

	public Aluno getLider() {
		return lider;
	}

	public void setLider(Aluno lider) {
		this.lider = lider;
	}

	public List<Aluno> getMembros() {
		return membros;
	}

	public void setMembros(List<Aluno> membros) {
		this.membros = membros;
	}

}
